home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lantools / bkup / r_proces.bat < prev    next >
DOS Batch File  |  1990-08-24  |  5KB  |  129 lines

  1. :... B_PROCES.BAT, Craig MacPherson
  2. :    This batch file processes backup requestes from users. It is called 
  3. :    from the users backup job batch file. This file is processed on the 
  4. :    backup server.
  5. :
  6. :    Variables passed
  7. :    %1 = Userid
  8. :    %2 = Requested Tape  
  9. :    %3 = Save Set
  10. :    %4 = Drive (C:)
  11. :    %5 = Opt Dir (\)
  12. :    %6 = Sub Dir Toggle (/S)
  13. :    %7 = Overwrite Toggle (/Q)
  14.  
  15. :... Set variables for tape change, read by Basic programs below
  16.      set REQ_TAPE=%2
  17.      set RE_LOAD=%TAPE%
  18.  
  19.  
  20. :... Del the que file to indicate processing has started
  21.      del %D2%\backups\restore.jbs\%1.que
  22.  
  23. :... Load Map Assist and connect to users workstation, remote drive o:
  24.      MA o:=Trilan1/%1
  25.      if errorlevel 1 goto NO_CONNECT
  26.  
  27. :... Clean out skipped and corrupt file logs
  28.      call %D1%b_skip.bat DELETE
  29.  
  30. :LOAD_TAPE
  31. :... Get Operator to load the tape
  32.      send "Tape mount requested by %1, tape - #%2" %NOTIFY%
  33.      be beep %SOUND%
  34.      cls
  35.      echo.
  36.      echo A tape mount has been requested, enter option:
  37.      echo.
  38.      echo  C - Tape #%2 is onsite, ( C )ontinue with tape mount request
  39.      echo  K - Tape #%2 is offsite, ( K )ill job and message user
  40.      echo.
  41.      echo Delay for 100 seconds, Enter Selection:
  42.      be ask "", ack DEFAULT=a TIMEOUT=100 
  43.      if errorlevel 3 goto OFF_SITE
  44.      if errorlevel 2 goto START_RESTORE
  45.      goto LOAD_TAPE
  46.  
  47. :START_RESTORE
  48.  
  49. :... Load backup tape
  50.      basica %d1%req_tape.bas
  51.      call req_tape.bat
  52.      del req_tape.bat
  53.       
  54. :... Update the backup system activity.log file with tape info
  55.      echo ***************** Tape Change: New Tape =%TAPE%  OP=%OP% **************************>tmp.inp
  56.      copy %D2%\backups\activity.lgs\activity.log + tmp.inp %D2%\backups\activity.lgs\activity.log>>nul:
  57.      del tmp.inp
  58.  
  59. :... Update the users detailed history log with restore info...
  60.      echo restore to %1 %4%5  with toggles %6%7   from tape #%2 set %3>>%D2%\backups\activity.lgs\%1.his
  61.  
  62. :... Start the restore process
  63.      set STATUS=GOOD
  64.      echo restoring to %1 %4%5  with toggles %6%7   from tape #%2 set %3
  65.      trestore o:%5/li:"files.tmp"/Y/V:%3%6%7
  66.      if errorlevel set STATUS=BAD
  67.    
  68. :UPDATE_LOGS
  69.  
  70.      :... Add Maynard tape program output to users detailed history log
  71.           if not exist %D2%\backups\restore.jbs\files.tmp set STATUS=BAD
  72.           if not exist %D2%\backups\restore.jbs\files.tmp echo "                              Restore Failed">>%D2%\backups\activity.lgs\%1.his 
  73.           copy %D2%\backups\activity.lgs\%1.his+%D2%\backups\restore.jbs\files.tmp %D2%\backups\activity.lgs\%1.his
  74.           if exist %D2%\backups\restore.jbs\files.tmp del %D2%\backups\restore.jbs\files.tmp>>nul:
  75.  
  76.      :... Check for skipped or corrupt files, add info to users detailed history log
  77.           call %D1%b_skip.bat %1
  78.           goto MARK_EOJ
  79.  
  80.      :NO_CONNECT
  81.      :... Mark users history log with no connect message
  82.           copy %D2%\backups\activity.lgs\%1.his+%D2%\backups\no_con.asc %D2%\backups\activity.lgs\%1.his
  83.           set STATUS=NO_CON
  84.  
  85.      :MARK_EOJ
  86.      :... Mark EOJ in users history file
  87.           call %D1%b_eoj.bat %1
  88.  
  89.      :... Strip Form Feeds from users history file
  90.           call %D1%b_strip.bat %1
  91.  
  92.      :SYSTEM AND USER SUMMARY LOGS
  93.      :... Add user info and status to system activity log and user summary log
  94.           call %D1%b_activ.bat RESTORE %STATUS% %1 %2 %3 %4 %5 %6 %7
  95.  
  96. :... Unload Mapassist 
  97.      MA -
  98.  
  99. :... Send user a message
  100.      send "Restore of %4%5 Completed" %1
  101.  
  102. :RELOAD
  103. :... Reload todays backup tape and place entry in activity log.
  104.      send "Tape mount requested, by Backup Server" %NOTIFY%
  105.      be beep %SOUND%
  106.      echo.
  107.      echo Prepare to mount todays backup tape
  108.      echo.
  109.      echo.
  110.      be ask "Hit X when ready to mount tape", cx DEFAULT=c TIMEOUT=50
  111.      if errorlevel 2 goto UPDATE_LOGS
  112.      goto RELOAD
  113.  
  114.      :... Re-load backup tape, sets env variables for OP and TAPE
  115.           basica %D1%re_load.bas
  116.           call re_load.bat
  117.           del re_load.bat 
  118.  
  119.      :... Update the backup system activity.log file with tape info
  120.           echo ***************** Tape Change: New Tape =%TAPE%  OP=%OP% **************************>tmp.inp
  121.           copy %D2%\backups\activity.lgs\activity.log + tmp.inp %D2%\backups\activity.lgs\activity.log>>nul:
  122.           del tmp.inp
  123.           goto END
  124.  
  125. :OFF_SITE
  126.      Send "Tape #%2 is Offsite, Contact Client Services" %1 
  127.  
  128. :END
  129.